//导入 redux   中横线表示不赞成的写法
// create 创建  store 存储 商店    apply 应用
import {createStore, applyMiddleware, combineReducers} from 'redux';
import thunk from 'redux-thunk';
import countReducer from './reducers/countReducer';
import zanReducer from './reducers/zanReducer';
import todoReducer, {requestGetTodo} from './reducers/todoReducer';
import {composeWithDevTools} from 'redux-devtools-extension'

//合并 reducer.  合并之后, 内部状态的值会变为一个对象
const rootReducer = combineReducers({
  count: countReducer, 
  zan: zanReducer,
  todo: todoReducer
}); 

const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)));

//暴露 store 对象
export default store;
